@file:JvmName("CovertUtil")

package org.example.sys.ui.util

import androidx.databinding.InverseMethod

@InverseMethod("getPublicationYear")
fun getPublicationYear(year: Int?): String {
    if (year == null || year == 0) {
        return ""
    }
    return "$year"
}

fun getPublicationYear(year: String?): Int? {
    return try {
        year?.toInt()
    } catch (e: Exception) {
        0
    }
}